package com.tom;

import com.tom.contants.Contants;
import dev.langchain4j.model.openai.OpenAiChatModel;
import dev.langchain4j.model.openai.OpenAiModelName;

import java.time.Duration;


public class Hello {

    public static void main(String[] args) {

        OpenAiChatModel model = OpenAiChatModel.builder()
                .apiKey(Contants.key)
                .modelName(OpenAiModelName.GPT_3_5_TURBO)
                .temperature(0.3)
                .timeout(Duration.ofSeconds(60))//60秒
                .logRequests(true)
                .logResponses(true)
                .build();
        String generate = model.generate("Say 'Hello World'");
        Contants.log(generate);

    }
}
